
    //移动信息
    function move(){
        layui.use(['form', 'jquery', 'layer'], function() {
            var $ = layui.jquery;
            var layer = layui.layer;

            var token = $('input[name="_token"]').val();

            var chk_value =[];
            $('input[name="ids[]"]:checked').each(function(){
                chk_value.push($(this).val());
            });
            if(chk_value.length==0){
                layer.msg('请选择要移动的记录',{shift: 6,icon:5});
                return false;
            }
            var class_id = $('#move_class_id').val();
            if(class_id < 1){
                layer.msg('请选择分类',{shift: 6,icon:5});
                return false;
            }
            layer.confirm('确定要移动所选记录？', function (index){
                $.post('{{url('move')}}', {ids:chk_value, class_id:class_id, _token:token}, function (data){
                    console.log(data);
                    if(data.code == 200){
                        layer.msg('操作成功');
                        window.location.reload();
                    }
                },'json');
                layer.close(index);
            });

        });
    }

    //批量删除
    function batchDelete(){
        layui.use(['form', 'jquery', 'layer'], function() {
            var $ = layui.jquery;
            var layer = layui.layer;

            var token = $('input[name="_token"]').val();

            var chk_value =[];
            $('input[name="ids[]"]:checked').each(function(){
                chk_value.push($(this).val());
            });
            if(chk_value.length==0){
                layer.msg('请选择要删除的记录',{shift: 6,icon:5});
                return false;
            }

            layer.confirm('确定要删除所选记录？', function (index){
                $.post('{{url('batchDelete')}}', {ids:chk_value, _token:token}, function (data){
                    console.log(data);
                    if(data.code == 200){
                        layer.msg('操作成功');
                        window.location.reload();
                    }
                },'json');
                layer.close(index);
            });

        });
    }

